package GUI.ElementosGUI;
import java.awt.event.*;
import javax.swing.*;

public class Janela extends JFrame{
	
	private static final long serialVersionUID = 1L;
	private ImagePanelInicial painel;
	private JFrame janelaPropria;
	private Menus menus;
	private String operador;

	public Janela(){
		super(":.. AGENDA MULTITUDO ..:");
		operador = "";
		janelaPropria = this;
		painel = new ImagePanelInicial();
		
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent evento){
				System.exit(0);
			}
		});
		setSize(1024, 748);
		setResizable(false);
	}
	
	public Janela(boolean fecha){
		super(":.. AGENDA MULTITUDO ..:");
		operador = "";
		janelaPropria = this;
		painel = new ImagePanelInicial();
		
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent evento){
				janelaPropria.setVisible(false);
				janelaPropria.dispose();
			}
		});

		setSize(1024, 748);
		setResizable(false);
	}
	
	public void setOperador(String operador){
		this.operador = operador;
	}
	
	public String getOperador(){
		return this.operador;
	}
	
	public void mudaPainel(JPanel painel){
		this.setContentPane(painel);
	}
	
	public void mostrar(){
		this.setVisible(true);	
	}

	public JFrame getJanelaPropria() {
		return janelaPropria;
	}

	public void setJanelaPropria(JFrame janelaPropria) {
		this.janelaPropria = janelaPropria;
	}

	public ImagePanelInicial getPainel() {
		return painel;
	}

	public void setPainel(ImagePanelInicial painel) {
		this.painel = painel;
	}
	
	public void setMenu(Menus menus){
		this.menus = menus;
	}
}
